package com.dajunkeji.cms.controller;

import com.dajunkeji.cms.dao.UserMapper;
import com.dajunkeji.cms.entity.User;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/a")
public class IndexController {

    @Autowired(required = false)
    private UserMapper userMapper;

    @ApiOperation(value = "获取全部用户",notes = "获取数据库的全部用户")
    @RequestMapping(value = "b",method = RequestMethod.GET)
    public ResponseEntity<List> getAllUser(){

        List<User> userList = userMapper.findAllUser();

        return ResponseEntity.ok(userList);

    }
}
